<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>

    <script>
        function time_msg()
        {
            var t = setTimeout("alert('5秒')", 5000);
        }
    </script>
</head>
<body>
<form>
    <input type="button" value="显示定时的警告框" onclick="time_msg()">
</form>
<p>请点击上面的按钮。警告框会在 5 秒后显示。</p>


<script>
    function time_over()
    {
        var t1 = setTimeout("document.getElementById('txt').value=2", 2000);
        var t2 = setTimeout("document.getElementById('txt').value=4", 4000);
        var t3 = setTimeout("document.getElementById('txt').value=6", 6000);
    }
</script>
<form>
    <input type="button" value="显示计时的文本" onclick="time_over()">
    <input type="text" id="txt">
</form>

<p>点击上面的按钮。输入框会显示出已经逝去的时间（2、4、6 秒）。</p>
<script>
    window.status("put your message here");
</script>
</body>
</html>